package com.diaohw.module.file.obj.convert;

import com.diaohw.module.file.obj.dto.CatalogDTO;
import com.diaohw.module.file.obj.entity.CatalogDO;
import com.diaohw.module.file.obj.vo.CatalogTreeVo;
import com.diaohw.module.file.obj.vo.CatalogVO;
import org.mapstruct.InheritConfiguration;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * <p>
 * 目录 类型转换
 * </p>
 *
 * @author D-Hw
 * @since 2024-11-05
 */
@Mapper
public interface CatalogConvert {

    CatalogConvert INSTANCE = Mappers.getMapper(CatalogConvert.class);

    /**
     * dto to entity
     */
    @InheritConfiguration
    CatalogDO dtoToEntity(CatalogDTO dto);

    /**
     * entity to dto
     */
    @InheritConfiguration
    CatalogDTO entityToDto(CatalogDO entity);

    /**
     * entity to dto
     */
    @InheritConfiguration
    CatalogVO entityToVo(CatalogDO entity);

    /**
     * entity to dto
     */
    @InheritConfiguration
    List<CatalogVO> entityToVo(List<CatalogDO> list);


    @InheritConfiguration
    List<CatalogTreeVo> toTree(List<CatalogDO> list);
}

